import request from '../utils/request.js'

// 获取监测点位的列表信息
export function featchMonitorSite(query) {
  return request({
    url: '/organizer/points/list/',
    method: 'get',
    params: query
  })
}
// 添加点位信息
export function addSiteHealthItem(data) {
  return request({
    url: '/organizer/points/',
    method: 'post',
    data
  })
}
// 编辑点位信息
export function updataSiteInfo(id, data) {
  return request({
    url: `/organizer/points/${id}/`,
    method: 'put',
    data
  })
}

// 资产信息中添加关联点位信息
export function addSiteInfo(id, data) {
  return request({
    url: `/organizer/points/${id}/`,
    method: 'patch',
    data
  })
}
// 删除点位信息
export function deleteSiteInfo(id) {
  return request({
    url: `/organizer/points/${id}/`,
    method: 'delete'
  })
}
// 详情点位信息
export function detailSiteInfo(id) {
  return request({
    url: `/organizer/points/${id}/`,
    method: 'get'
  })
}

// 获取关联传感器的信息
export function featchSiteRelevance(query) {
  return request({
    url: '/organizer/points/device/list/',
    method: 'get',
    params: query
  })
}
// 更换传感器
export function addASiteRelevance(data) {
  return request({
    url: '/organizer/points/device/',
    method: 'post',
    data
  })
}
// 编辑传感器
export function updataSiteRelevance(id, data) {
  return request({
    url: `/organizer/points/device/${id}/`,
    method: 'put',
    data
  })
}

// 删除传感器
export function deleteSiteRelevance(id) {
  return request({
    url: `/organizer/points/device/${id}/`,
    method: 'delete'
  })
}
// 详情传感器
export function detailSiteRelevance(id) {
  return request({
    url: `/organizer/points/device/${id}/`,
    method: 'get'
  })
}

// 添加点位类型配置信息
export function createPointType(data) {
  return request({
    url: '/bms/param-list/',
    method: 'post',
    data
  })
}

// 修改点位类型配置信息
export function updatePointType(id, data) {
  return request({
    url: `/bms/param-list/${id}/`,
    method: 'put',
    data
  })
}

// 删除点位类型配置信息
export function deletePointType(id) {
  return request({
    url: `/bms/param-list/${id}/`,
    method: 'delete'
  })
}

